﻿using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{
    
    [ServiceContract(Namespace = "http://HRMService")]
    public interface IRoleRight
    {
        [OperationContract]
        DataSet GetAllModule();

        [OperationContract]
        DataSet GetAllByRole(string RoleID);

        [OperationContract]
        bool Delete(string RoleID);

        [OperationContract]
        bool Update(string RoleID, string ModuleID, bool ViewRight, bool CreateRight, bool UpdateRight, bool PrintRight, bool DeleteRight);

        [OperationContract]
        bool Insert(string RoleID, string ModuleID, bool ViewRight, bool CreateRight, bool UpdateRight, bool PrintRight, bool DeleteRight);

        [OperationContract]
        RoleRightInfo RoleRight_GetRoleRight(string UserName, string ModuleID);

    }
    [DataContract(Namespace = "http://HRMService")]
    public class RoleRightInfo
    {
          
        public RoleRightInfo()
        {
            _view = false;
            _create = false;
            _update = false;
            _delete = false;
            _print = false;
        }
        [DataMember]
        private bool _view, _create, _update, _delete, _print;
        [DataMember]
        public bool View
        {
            get { return _view; }
            set { _view = value; }
        }
        [DataMember]
        public bool Print
        {
            get { return _print; }
            set { _print = value; }
        }
        [DataMember]
        public bool Create
        {
            get { return _create; }
            set { _create = value; }
        }
        [DataMember]
        public bool Update
        {
            get { return _update; }
            set { _update = value; }
        }
        [DataMember]
        public bool Delete
        {
            get { return _delete; }
            set { _delete = value; }
        }
    }
   
}
